#include <stdio.h>
float *max1(float a, float b, float c)
{
    static float d;
    if (a > b) // comparing a and b
        d = a;
    else
        d = b;
    if (c > d) // comparing max(a,b) and c
        d = c;
    return &d;
}

float ptr;
float *max(float a, float b, float c)
{
    if (a >= b && a >= c)
    {
        // return &a;
        ptr = a;
    }
    else if (b >= a && b >= c)
    {
        // return &b;
        ptr = b;
    }
    else
    {
        // return &c;
        ptr = c;
    }
    return &ptr;
}
int main() /* 要调用上面定义函数的主函数 */
{
    float *p; /* 指针 */
    float a1, a2, a3;
    a1 = 386.7;
    a2 = 66.1;
    a3 = 99.1;
    p = max(a1, a2, a3);
    printf("The maximal value is : %f\n", *p);
    return 0;
}
